<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="委托单分配任务" libs=["table"]/>
<div class="container-div" id="_app">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <@f.form id="module-form">
            <div class="select-list">
                <ul>
                    <li >
                        <label>工程类别： </label>
                        <@f.input id="projectType" name="projectType"/>
                    </li>

                    <li class="select-time">
                        <label>开始时间： </label>
                        <@f.input id="startTime" name="beginTime"/>
                    </li>
                    <li >
                        <label>送检账户： </label>
                        <@f.input id="entrustCode" name="entrustCode"/>
                    </li>

                    <li >
                        <label>委托单位： </label>
                        <@f.input id="entrustUnit" name="entrustUnit"/>
                    </li>
                    <li >
                        <label>送样人： </label>
                        <@f.input id="inspectionUser" name="inspectionUser"/>
                    </li>


                    <!--<li>-->
                        <!--<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>  <@ctx.i18n text = "查询"/></a>-->
                        <!--<a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i> <@ctx.i18n text = "重置"/></a>-->
                    <!--</li>-->
                </ul>
                <ul>

                    <li >
                        <label>检验编号： </label>
                        <@f.input id="entrustCode" name="entrustCode"/>
                    </li>
                    <li class="select-time">
                        <label>结束时间： </label>
                        <@f.input name="endTime"/>
                    </li>

                    <li >
                        <label>工程名称： </label>
                        <@f.input id="projectName" name="projectName"/>
                    </li>
                    <li >
                        <label>送检账户： </label>
                        <@f.input id="projectName" name="projectName"/>
                    </li>

                    <li >
                        <label>委托序号： </label>
                        <@f.input id="projectName" name="projectName"/>
                    </li>


                    <li>
                        <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>  <@ctx.i18n text = "查询"/></a>
                        <a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i> <@ctx.i18n text = "重置"/></a>
                    </li>
                </ul>
            </div>
        </@f.form>
    </div>
    <@table id="bootstrap-table">
    <!--<@shiro.hasPermission name="pms:entrustTask:add">-->
    <!--<a class="btn btn-success" onclick="opt.operate.addTab(0)">-->
        <!--<i class="fa fa-plus"></i> <@ctx.i18n text = "新增"/>-->
    <!--</a>-->
    <!--</@shiro.hasPermission>-->
    <!--<@shiro.hasPermission name="pms:entrustTask:edit">-->
    <!--<a class="btn btn-primary" onclick="opt.operate.editTab()">-->
        <!--<i class="fa fa-edit"></i> <@ctx.i18n text = "修改"/>-->
    <!--</a>-->
    <!--</@shiro.hasPermission>-->
    <!--<@shiro.hasPermission name="pms:entrustTask:del">-->
    <!--<a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()">-->
        <!--<i class="fa fa-remove"></i> <@ctx.i18n text = "删除"/>-->
    <!--</a>-->
    <!--</@shiro.hasPermission>-->
    <!--<@shiro.hasPermission name="pms:entrustTask:export">-->
    <!--<a class="btn btn-warning" onclick="$.table.exportExcel()">-->
        <!--<i class="fa fa-download"></i> 导出-->
    <!--</a>-->

    <!--</@shiro.hasPermission>-->
<!--&lt;!&ndash;onclick="upload()"&ndash;&gt;-->
    <!--<a class="btn btn-info"  id="licSelect">-->
        <!--<i class="fa fa-upload"></i> 导入-->
        <!--&lt;!&ndash;<input   id="files"  type="file" />&ndash;&gt;-->
        <!--&lt;!&ndash;<input type="file" id="files" value="" style="display:none">&ndash;&gt;-->
    <!--</a>-->



</@table>
</div>
</div>
<@footer>
<script type="text/javascript">
    var statusDatas = ${dict.getDictListJson('project_status')};
    var editFlag = "${permission.hasPermi("pms:entrustTask:edit")}";
    var listFlag = "${permission.hasPermi("pms:entrustTask:add")}";
    // var categoryDatas = ${dict.getDictListJson('sys_bpm_category')};
    var prefix = baseURL + "pms/entrustTask";

    $(function() {
        var options = {
            url: prefix + "/list",
            // showSearch: false,
            // showRefresh: false,
            // showToggle: false,
            // showColumns: false,
            // clickToSelect: true,
            sortName: "id",
            delUrl: prefix + "/del",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",//认领箱
            exportUrl: prefix + "/export",
            importUrl: prefix + "/import",
            uniqueId: 'id' , /* 唯一ID */
            modalName: "委托单任务分配",
            columns: [
                // {field: 'selectItem', radio: true},
                {title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                        return $.table.serialNumber(index);}},
                // {field : 'id',title : '<@ctx.i18n text = "编号"/>'},
                // {field : 'inspectionAccount',title : '<@ctx.i18n text = "送检账户"/>'},
                {field : 'entrustCode',title : '<@ctx.i18n text = "委托编号"/>'},
                {field : 'entrustTitle',title : '<@ctx.i18n text = "委托标题"/>'},
                {field : 'projectName',title : '<@ctx.i18n text = "工程名称"/>'},
                {field : 'grade',title : '<@ctx.i18n text = "抗震等级"/>'},
                // {field : 'samplers',title : '<@ctx.i18n text = "取样人签名"/>'},
                // {field : 'witness',title : '<@ctx.i18n text = "见证人"/>'},
                // {field : 'collect',title : '<@ctx.i18n text = "收样人"/>'},
                {field : 'entrustTime',title : '<@ctx.i18n text = "委托日期"/>'},
                // {field : 'entrustUnit',title : '<@ctx.i18n text = "委托单位"/>'},
                // {field : 'entrustIphone',title : '<@ctx.i18n text = "委托电话"/>'},
                {field : 'collect',title : '<@ctx.i18n text = "收样人"/>'},
                {field : 'taskName',title : '<@ctx.i18n text = "检验员"/>'},
                //     {field : 'id',title : ''},

                {title:"<@ctx.i18n text = "操作"/>",align: 'left',class:'action',formatter: function(value, row, index) {
                        if(row.taskName === "") {
                        var actions = [];
                //         // actions.push('<a class="" href="javascript:void(0)" title="<@ctx.i18n text = "关联流程表单"/>" onclick="taskFrom(\'' + row.id + '\')"><i class="fa icon-organization"></i></a> ');
                // //        actions.push('<a class="" href="javascript:void(0)" title="<@ctx.i18n text = "认领修改"/>" onclick="taskFromEdit(\'' + row.id + '\')">认领修改</a> ');
                            actions.push('<a class="" href="javascript:void(0)" title="<@ctx.i18n text = "分配任务"/>" onclick="task(\'' + row.id + '\')">分配任务</a> ');
                            return actions.join('');
                        }
                }}
            ]
        };
        $.table.init(options);
    });

    function task(id){
        opt.modal.open("分配任务",prefix + "/taskAdd/"+id);
    }

    function DeptDoSubmit(index, layero) {

        var body = layer.getChildFrame('body', index);
        console.log(body);
        importTable(body.find('#fileName').val());
        layer.close(index);
    }

    function taskFromEdit(id) {
        opt.modal.openTab("认领修改",prefix + "/edit/"+id);
    }

    function taskFrom(id){
        opt.modal.openTab("关联表单",prefix + "/taskfrom/"+id);
    }

</script>
<script id="check" type="text/template">
<form id="inputForm" method="post" enctype="multipart/form-data" class="form-horizontal mt20 mb10">
    <label class="control-label col-xs-5" >

            <button type="button" class="btn btn-sm btn-primary" onclick="opt.form.submit()"><i class="fa fa-check"></i><@ctx.i18n text = "出库"/></button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="opt.modal.closeTab()"><i class="fa fa-reply-all"></i><@ctx.i18n text = "取消"/></button>


    </label>
    <!--<div class="col-xs-7">-->
        <!--<button type="button" class="btn btn-sm btn-primary" onclick="opt.form.submit()"><i class="fa fa-check"></i><@ctx.i18n text = "保存"/></button>&nbsp;-->
        <!--<button type="button" class="btn btn-sm btn-danger" onclick="opt.modal.closeTab()"><i class="fa fa-reply-all"></i><@ctx.i18n text = "关闭"/></button>-->
    <!--</div>-->
</form>

</script>
</@footer>
</@pageTheme>